package com.engine.common.baseEntity.gis;

import com.alibaba.fastjson.JSON;

public class BaseFeature<T extends BaseGeoEntity>{

    public BaseFeature(){

    }
    public BaseFeature(T geoEntity) {
        geometry= JSON.parseObject(geoEntity.geojson);
        type="Feature";
        properties=geoEntity;
    }

    private String type;
    private Object geometry;
    private T properties;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Object getGeometry() {
        return geometry;
    }

    public void setGeometry(Object geometry) {
        this.geometry = geometry;
    }

    public T getProperties() {
        return properties;
    }

    public void setProperties(T properties) {
        this.properties = properties;
    }

    @Override
    public String toString() {
        return "Feature{" +
                "type='" + type + '\'' +
                ", geometry='" + geometry + '\'' +
                ", properties=" + properties +
                '}';
    }

}
